//
//  CS_Page_ImageViewer.m
//  Pods
//
//  Created by 网新中研 on 17/3/30.
//
//

#import "CS_Page_ImageViewer.h"
#import "XMNPhotoPreviewCell.h"

@interface CS_Page_ImageViewer()

@property (nonatomic, strong) UIImage *image;

@end

@implementation CS_Page_ImageViewer

+(instancetype)page_imageViewer:(UIImage *)image{
    
    CS_Page_ImageViewer *page_ImageViewer = [[CS_Page_ImageViewer alloc]init];
    page_ImageViewer.image = image;
    page_ImageViewer.frame = CGRectMake(0, 0, kWindowW, kWindowH);
    [page_ImageViewer layoutView];
    return page_ImageViewer;
    
}

-(void)layoutView{
    WS(weakSelf);
    XMNPhotoPreviewCell *photoPreviewCell = [[XMNPhotoPreviewCell alloc]initWithFrame:CGRectMake(0, 0, kWindowW, kWindowH)];
    
    [photoPreviewCell configCellWithImage:self.image];
    
    photoPreviewCell.singleTapBlock = ^(void){
        if (weakSelf.superKLCPopup != nil) {
            [weakSelf.superKLCPopup dismiss:YES];
        }
    };
    
    [self addSubview:photoPreviewCell];
}

@end
